package com.smart.terminal.config;

import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.ChannelSftp;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * sftp 配置类
 *
 * @author wf
 * @version 1.0.0
 * @since 2022/11/10
 */
@Configuration
public class PoolConfig {

    @Bean
    @ConfigurationProperties(prefix = "pool.sftp")
    public GenericObjectPoolConfig<ChannelSftp> sftpPoolConfig() {
        return new GenericObjectPoolConfig<>();
    }
    @Bean
    @ConfigurationProperties(prefix = "pool.exec")
    public GenericObjectPoolConfig<ChannelExec> execPoolConfig() {
        return new GenericObjectPoolConfig<>();
    }

}
